{  Statement: http://acmp.ru/?main=task&id_task=511
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    n,x:longint;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
if n > 145 then begin
    write('NO');
    halt(0);
end;
x := 0;
if not odd(n) then x := 5;
inc(x, 10 * ((n - 1) shr 1));
write(x div 60,' ',x mod 60);
end.